package com.itheima.d1_serializable;

import java.io.*;

/**
 * 对象序列化，将对象存储到指定文件中去
 */
public class test {
    public static void main(String[] args) throws Exception {
        student s = new student("Leo",19,"114541108");
        //对象序列化操作
        ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream("D:\\java-project\\opp-app3\\obj.txt"));

        //直接调用序列化方法
        oos.writeObject(s);

        //释放资源
        oos.close();
    }
}
